package com.dong.yi18health;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

public class SplashActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
		init();
	}

	private void init() {
		new Thread() {
			public void run() {
				try {
					Thread.sleep(3000);
					seach();
				} catch (Exception e) {
					e.printStackTrace();
				}
			};
		}.start();

	}

	protected void seach() {
		SharedPreferences share = getSharedPreferences("first", Context.MODE_PRIVATE);
		boolean b = share.getBoolean("isfirst", true);
		if (b) {
			Intent it = new Intent(SplashActivity.this, GuideActivity.class);
			startActivity(it);
		} else {
			Intent it = new Intent(SplashActivity.this, MainActivity.class);
			startActivity(it);
		}

	}

}
